﻿using System;
using System.Windows.Forms;
using Zwms.Client.CommonUI;

namespace Zwms.Client.ManageWms
{
    public partial class PlanDateSelForm : BaseForm
    {
        #region 成员变量
        public DateTime SelectedDateTime { get; set; }
        #endregion

        #region 构造函数
        public PlanDateSelForm()
        {
            InitializeComponent();
            this.InitBtnImage();
            ServiceReferenceZwms.ServiceZwmsClient client = new ServiceReferenceZwms.ServiceZwmsClient();
            datePicker.Value = client.GetCurrentSystemTime();
            SelectedDateTime = datePicker.Value;
        }
        #endregion

        #region 私有函数
        private void InitBtnImage()
        {
            this.btnConfirm.Image = global::Zwms.Client.Properties.Resources.ok;
            this.btnCancel.Image = global::Zwms.Client.Properties.Resources.cancel;

        }
        #endregion

        #region 控件函数
        private void btnConfirm_Click(object sender, EventArgs e)
        {
            this.SelectedDateTime = datePicker.Value;
            this.DialogResult = DialogResult.OK;
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }

        private void datePicker_ValueChanged(object sender, EventArgs e)
        {
            SelectedDateTime = datePicker.Value;
        }
        #endregion

    }
}
